package me.ratel.demo.wechat.entities;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * @author Administrator
 * @time 2016/9/4 16:50
 */
public class GetMenuResponse {
    @JSONField(name = "menu")
    private Menu menu;

    @JSONField(name = "menuid")
    private Integer menuId;

    public class Menu {
        @JSONField(name = "button")
        private Button[] buttons;

        public class Button {
            @JSONField(name = "type")
            private String type;

            @JSONField(name = "name")
            private String name;

            @JSONField(name = "key")
            private String key;

            @JSONField(name = "sub_button")
            private Button[] subButtons;
        }
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    public Integer getMenuId() {
        return menuId;
    }

    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }

    public String toString() {
        return getMenu()==null? "": JSON.toJSONString(this);
    }
}
